Skip to content

Add opt-in request correlation#126

Merged
vishalanandl177 merged 1 commit into
mainfrom
codex/SCRUM-9-request-correlation-no-db
Jul 4, 2026
Merged

Add opt-in request correlation#126
vishalanandl177 merged 1 commit into
mainfrom
codex/SCRUM-9-request-correlation-no-db

Conversation

@vishalanandl177

Copy link
Copy Markdown
Owner

Summary

Implements SCRUM-9 request correlation as an opt-in runtime feature without changing database persistence.

  • Adds correlation helpers for safe request IDs, W3C traceparent trace IDs, route metadata, low-cardinality labels, and allowlisted opaque context IDs.
  • Adds a ContextVar-backed logging context for request-scoped application logging.
  • Wires middleware request attributes and signal payload keys: correlation and low_cardinality.
  • Updates README, Sphinx docs, tutorials, compliance/operations guidance, and llms.txt.
  • Adds tests for helper behavior, middleware integration, unchanged DB payload shape, no model fields, and no migration additions.

Database Boundary

This PR intentionally does not add APILogsModel fields, migrations, admin columns, database indexes, or synthetic queued database payload fields. Correlation is exposed through request attributes, logging context, and signals only.

Validation

  • python -m django test tests --settings=tests.test_settings --verbosity=1 -> 180 tests OK
  • python test_runner_simple.py -> 25 tests OK
  • python -m django makemigrations drf_api_logger --settings=tests.test_settings --check --dry-run --verbosity=2 -> No changes detected
  • python -m sphinx -b html docs (Join-Path $env:TEMP 'drf-api-logger-docs-build-pr') -W --keep-going -> build succeeded
  • git diff --check HEAD -> clean

Notes

origin/main already includes SCRUM-8 via PR #125, so this branch was rebased onto current origin/main before push.

@vishalanandl177 vishalanandl177 changed the title [codex] Add opt-in request correlation Add opt-in request correlation Jul 3, 2026
@vishalanandl177
vishalanandl177 marked this pull request as ready for review July 4, 2026 08:25
@vishalanandl177
vishalanandl177 merged commit 73bc7f4 into main Jul 4, 2026
6 checks passed
@vishalanandl177
vishalanandl177 deleted the codex/SCRUM-9-request-correlation-no-db branch July 4, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant